/**
 * 访问“用户”接口网络模块
 */

import axios from "./axios.config";
import util from "./util";

class UserApi{
    async login(data) {
        let result = await axios.post("/users/login", data);
        return util.jsonTransfer(result.data);
    }

    async logout() {
        let result = await axios.get("/users/logout");
        return util.jsonTransfer(result.data);
    }

    async find(userId) {
        let result = await axios.get(`/users/${userId}`);
        return util.jsonTransfer(result.data);
    }
}

export default UserApi;